import request from '@/utils/request'

export const regAPI = obj => {
  return request.post('/api/reg', obj)
}
export const loginAPI = obj => {
  return request.post('/api/login', obj)
}

export const getUserAPI = () => {
  return request.get('/my/userinfo')
}
// 更新用户数据
export const updateUserAPI = data => {
  return request.put('/my/userinfo', data)
}

// 重置密码，箭头函数简写
export const updatePwdAPI = data => request.patch('/my/updatepwd', data)

// 上传头像
export const uploadAPI = base64 => request.patch('/my/update/avatar', { avatar: base64 })
